/* ***************************
* 电子表格预览界面导出Excel
* @Editer wangjunfu
* ****************************/

/**
 * 电子表格 导出EXCEL
 */
function exportTable(sheetid) {

    if (sheetid === undefined || sheetid === null || sheetid === "") {
        showInfoAlert("你要导出数据不存在，请检查！", null);
        return;
    }

    window.location.href = "/analysis/export/exportExcel?sheetid=" + sheetid + composeParams();
}

/**
 * 合成表格 导出EXCEL
 */
function exportComposeTable(composeid) {

    if (composeid === undefined || composeid === null || composeid === "") {
        showInfoAlert("你要导出数据不存在，请检查！");
        return;
    }

    window.location.href = "/analysis/export/exportComposeTable?composeid=" + composeid + composeParams();
}

// 组合当前参数
function composeParams() {
    var url_param = "";

    var _daterange = $("#daterange").val();
    if (_daterange !== "" && _daterange !== undefined) {
        url_param += "&daterange=" + _daterange;
    }

    var _datepicker = $("#datepicker").val();
    if (_datepicker !== "" && _datepicker !== undefined) {
        url_param += "&datepicker=" + _datepicker;
    }

    var _textParamJson = $("#textParamJson").val();
    if (_textParamJson !== "" && _textParamJson !== undefined) {
        url_param += "&textParamJson=" + _textParamJson;
    }

    var _fuzzyParamJson = $("#fuzzyParamJson").val();
    if (_fuzzyParamJson !== "" && _fuzzyParamJson !== undefined) {
        url_param += "&fuzzyParamJson=" + _fuzzyParamJson;
    }

    var _selectParamJson = $("#selectParamJson").val();
    if (_selectParamJson !== "" && _selectParamJson !== undefined) {
        url_param += "&selectParamJson=" + _selectParamJson;
    }

    var _timeParamJson = $("#timeParamJson").val();
    if (_timeParamJson !== "" && _timeParamJson !== undefined) {
        url_param += "&timeParamJson=" + _timeParamJson;
    }

    return url_param;
}